<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 品牌模型
 */
class Brand extends Model
{
    protected $table = 'brand';
    protected $primaryKey = 'brand_id';
    public $timestamps = false; //关闭模型自动维护时间戳

    /* 品牌列表数据 */
    public static function pageData($limit)
    {
        return self::paginate($limit)->toArray();
    }
    /* 查找 */
    public static function brandFirst($brand_id)
    {
        return self::where('brand_id', $brand_id)->first();
    }
    /* 品牌添加 */
    public static function brandAdd($data)
    {
        return self::insert($data);
    }
    /* 品牌删除 */
    public static function brandDel($brand_id)
    {
        return self::where('brand_id', $brand_id)->delete();
    }
    /* 品牌修改 */
    public static function brandSave($brand_id, $datas)
    {
        return self::where('brand_id', $brand_id)->update($datas);
    }

}
